package com.assembly.feign;


import com.assembly.entities.Resources;
import com.assembly.entities.SystemUser;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

// 远程调用mengxuegu-blog-system微服务中的接口
@FeignClient(value = "system-server", path = "/system")
public interface IFeignSystemController {

    @ApiImplicitParam(name = "username", value = "用户名", required = true)
    @ApiOperation("Feign接口-通过用户名查询用户信息")
    @GetMapping("/api/feign/user/{username}/{type}")
    SystemUser findUserByUsername(@PathVariable("username") String username,@PathVariable("type")int type);


    @ApiImplicitParam(name = "username", value = "用户名", required = true)
    @ApiOperation("Feign接口-通过用户名查询用户信息")
    @GetMapping("/api/feign/mobile/{mobile}/{type}")
    SystemUser findUserByMobile(@PathVariable("mobile") String mobile,@PathVariable("type")int type);



    @ApiImplicitParam(name = "username", value = "用户名", required = true)
    @ApiOperation("Feign接口-通过用户名查询用户信息")
    @GetMapping("/api/feign/wechat/{openid}/{type}")
    SystemUser findUserByOpenid(@PathVariable("openid") String openid,@PathVariable("type")int type);




    @ApiImplicitParam(name = "userId", value = "用户ID", required = true)
    @ApiOperation("Feign接口-通过用户ID查询拥有权限")
    @GetMapping("/api/feign/menu/{userId}")
    List<Resources> findMenuListByUserId(@PathVariable("userId") String userId);
}
